9 unsigned long long f
[1005][1005];
13 while (cin
>> n
>> row
>> col
&& n
){
15 for (int i
=1; i
<=n
; ++i
) cin
>> f
[i
][1];
17 for (int j
=1; j
<=n
+1; ++j
) f
[1][j
] = f
[n
][j
] = 1;
19 for (int j
=2; j
<=n
+1; ++j
)
20 for (int i
=2; i
<n
; ++i
)
21 f
[i
][j
] = (f
[i
+1][j
-1]*f
[i
-1][j
]+1)/f
[i
][j
-1];
25 for (int i=1; i<=n; ++i){
26 for (int j=1; j<=n+1; ++j)
27 printf("%3d ", f[i][j]);
32 while (col
> n
+1) col
-= n
+1;
34 cout
<< f
[row
][col
] << endl
;